<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>AGS Tween Module 1.21 Help</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
body, div, ul, li, pre { margin: 0; padding: 0; }
body {
	font: 10pt Verdana, Helvetica, Arial, sans-serif;
	color: #000;
	background: #FFFFE1;
	width: 100%; height: 100%;
}
h2 { margin: 2em 0 1em; }
pre { background: #fff; padding: 1em; border: 1px dashed #999; overflow: auto; }
hr { border: 1px solid #999; margin: 2em 0; }
ul { padding-left: 1.5em; }
h4 { margin-bottom: 0.2em; }
#container { width: 100%; height: 100%; position: absolute; }
#nav {
	width: 16.5em; height: 100%; padding: 0 .5em;
	position: fixed; overflow: auto;  top: 0; left: 0;
	background: white; border-right: 1px solid #CCC;
}
#content { margin-left: 17.5em; padding: 0 .5em; overflow: auto; height: 100%; }
#content p { width: 42em; }
#content h4 { font-weight: normal; margin-bottom: 0.2em; font-size: 0.9em; color: #f00; }
</style>	
</head>

<body>
<div id="container">

<div id="nav">
<h4>General</h4>
<ul>
	<li><a href="#about">About</a></li>
	<li><a href="#license">License</a></li>
	<li><a href="#audio">Audio Compatibility</a></li>
	<li><a href="#settings">Settings</a></li>
</ul>

<h4>Enumerated types</h4>
<ul>
	<li><a href="#TweenTiming">TweenTiming</a></li>
	<li><a href="#TweenStyle">TweenStyle</a></li>
	<li><a href="#TweenStopResult">TweenStopResult</a></li>
</ul>

<h4>Functions</h4>
<ul>
	<li><a href="#SecondsToLoops">SecondsToLoops</a></li>
	<li><a href="#WaitSeconds">WaitSeconds</a></li>
	<li><a href="#StopAllTweens">StopAllTweens</a></li>
	<li><a href="#TweenPosition">TweenPosition</a></li>
	<li><a href="#TweenScaling">TweenScaling</a></li>
	<li><a href="#TweenSize">TweenSize</a></li>
	<li><a href="#TweenStopAll">TweenStopAll</a></li>
	<li><a href="#TweenTransparency">TweenTransparency</a></li>
	<li><a href="#TweenViewportX">TweenViewportX</a></li>
	<li><a href="#TweenViewportY">TweenViewportY</a></li>
	<li><a href="#TweenViewportXY">TweenViewportXY</a></li>
	<li><a href="#TweenGamma">TweenGamma</a></li>
	<li><a href="#TweenShakeScreen">TweenShakeScreen</a></li>
	<li><a href="#TweenAreaScaling">TweenAreaScaling</a></li>
	<li><a href="#TweenZOrder">TweenZOrder</a></li>
	<li><a href="#TweenImage">TweenImage</a></li>
	<li><a href="#TweenAnimationSpeed">TweenAnimationSpeed</a></li>
	<li><a href="#TweenLightLevel">TweenLightLevel</a></li>
	<li><a href="#TweenTintR">TweenTintR</a></li>
	<li><a href="#TweenTintG">TweenTintG</a></li>
	<li><a href="#TweenTintB">TweenTintB</a></li>
	<li><a href="#TweenTintAmount">TweenTintAmount</a></li>
	<li><a href="#TweenTintBlackAndWhite">TweenTintBlackAndWhite</a></li>
	<li><a href="#TweenColorR">TweenColorR</a></li>
	<li><a href="#TweenColorG">TweenColorG</a></li>
	<li><a href="#TweenColorB">TweenColorB</a></li>
	<li><a href="#TweenValue">TweenValue</a></li>
	<li><a href="#TweenHandleOffset">TweenHandleOffset</a></li>
	<li><a href="#TweenSelectedItem">TweenSelectedItem</a></li>
	<li><a href="#TweenTopItem">TweenTopItem</a></li>
	<li><a href="#TweenSoundVolume">TweenSoundVolume</a></li>
	<li><a href="#TweenMusicMasterVolume">TweenMusicMasterVolume</a></li>
	<li><a href="#TweenDigitalMasterVolume">TweenDigitalMasterVolume</a></li>
	<li><a href="#TweenChannelVolume">TweenChannelVolume</a></li>
	<li><a href="#TweenSpeechVolume">TweenSpeechVolume</a></li>
</ul>

</div>

<div id="content">

<h1><a name="about"></a>Tween Module</h1>
<p>For <a href="http://www.adventuregamestudio.co.uk/">Adventure Game Studio</a></p>
<p>Version 1.21 (See <a href="CHANGES.TXT">CHANGES.TXT</a> for details)</p>
<p>Created by Edmundo Ruiz (edmundo@edmundito.com)<br/>
Additional scripting by Tzach Shabtay</p>

<p>This module can be used to create programatic animations.
It supports most of the ags systems. It allows these
effects to be  blocking, non blocking, or loop them, and it has
acceleration/deceleration timing functions.</p>

<p>Note that the script syntax differs a bit between AGS 3.x and AGS 2.x,
which will be noted in this documentation. You can also make the AGS 2.x syntax also available in AGS 3.x; check out
the <a href="#settings">Settings</a> section for more info.</p>

<h2><a name="license"></a>License</h2>

<p>This module is distributed with the very liberal <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>.</p>

<p>That said, you are most welcome but not obliged to give us credit in your game as:</p>

<p>
<strong>Special Thanks</strong><br/>
Edmundo Ruiz<br/>
Tzach Shabtay
</p>

<p>And in the AGS Games database:</p>
<p>
netmonkey Tween Module<br/>
tzachs Tween Module
</p>

<h2><a name="audio">Audio Compatibility</a></h2>

<p>Please note that currently most of the functions for tweening music and sound effects are written with the old-style audio scripting system, which is the default
up to AGS version 3.2.</p>

<p>If you're using AGS 3.2 or later and would like to use these functions, you have to set the <em>"Enforce new-style audio scripting system"</em>
to <strong>False</strong>. Either way, the Tween module is compatible with AGS 3.2 or later versions.

<p>Better audio support will (hopefully) come in a future version.</p>

<h2><a name="settings">Settings</a></h2>

<p>At the top of the script module header, there are a few constants that affect how the Tween module works:</p>

<pre>
#define MAX_TWEENS 10

#define DEFAULT_TweenTiming eLinearTween
#define DEFAULT_GUI_TweenTiming eLinearTween

#define DEFAULT_TweenStyle eBlockTween
#define DEFAULT_GUI_TweenStyle eBlockTween

#define DEFAULT_TweenStopResult ePauseTween

#ifdef AGS_SUPPORTS_IFVER
#ifver 3.0

#define NO_VER_2_TWEENS 

#endif
#endif
</pre>

<p>These #defines allow you to change some of the defaults very easily!</p>

<ul>
	<li><strong>MAX_TWEENS</strong> is the number of simultaneous tweens that can be played in the game. Note that increasing this number may slow down your game, so make sure you do it if you really need to.</li>
	<li><strong>DEFAULT_TweenTiming</strong> changes the default value for the optional <a href="#TweenTiming">TweenTiming</a> in all the Tween functions, except for GUI-Related tweens.</li>
	<li><strong>DEFAULT_GUI_TweenTiming</strong> changes the default value for the optional <a href="#TweenTiming">TweenTiming</a> in all the GUI-related Tween functions.</li>
	<li><strong>DEFAULT_TweenStyle</strong> changes the default value for the optional <a href="#TweenStyle">TweenStyle</a> in all the Tween functions, except for GUI-Related tweens.</li>
	<li><strong>DEFAULT_GUI_TweenStyle</strong> changes the default value for the optional <a href="#TweenStyle">TweenStyle</a> in all the GUI-related Tween functions.</li>
	<li><strong>DEFAULT_TweenStopResult</strong> changes the default value for the optional <a href="#TweenStopResult">TweenStopResult</a> in all the Tween stop functions.</li>
	<li><strong>NO_VER_2_TWEENS</strong> Only available in AGS 3.0 and above, it turns off the 2.0 based Tween function syntax. If you're migrating Tween code from a game created in 2.0, you can comment this line out and it will work!</li>
</ul>

<p>GUI-related objects have been specifically chosen to have their own TweenTiming and TweenStyle setting because very often
GUIs can have a more consistent and graceful transition animations as well as from a interface design standpoint
it's much nicer to move the user interface around without blocking the user. This, however, would require more clever scripting and it
may be a bit more advanced for beginning AGS scripters.</p>

<h2>Enumerated types</h2>

<h3><a name="TweenTiming">TweenTiming</a></h3>
<pre>
enum TweenTiming {
  eLinearTween,
  eEaseInTween,
  eEaseOutTween, 
  eEaseInEaseOutTween
};
</pre>

<p>Used to set the timing of the tween, whether it's just a linear interpolation,
one that only accelerates when it starts, one that only decelerates when it ends,
or both accelerates at start and decelerates at end.</p>

<hr />

<h3><a name="TweenStyle">TweenStyle</a></h3>
<pre>
enum TweenStyle {
  eBlockTween, 
  eNoBlockTween, 
  eRepeatTween, 
  eReverseRepeatTween,
};
</pre>
<p>Used to set the style of the tween, whether is blocking, non-blocking, repeating,
or repeating reverse (where at the end of the tween cycle and repeats, it reverses
the direction of the tween).</p>

<hr />

<h3><a name="TweenStopResult">TweenStopResult</a></h3>
<pre>
enum TweenStopResult {
  ePauseTween, 
  eFinishTween, 
  eResetTween,
};
</pre>
<p>Used to set how a tween should stop when any of the stop functions is called, whether
it should stay where it is (pause), complete the tween immediately (finish), or go back to where
it started (reset).</p>

<hr />

<h2>Functions</h2>

<h3><a name="SecondsToLoops">SecondsToLoops</a></h3>
<pre>
// AGS 2.x and 3.x
SecondsToLoops(float seconds);
</pre>
<p>Converts and returns the number of seconds into game loops.</p>
<h4>Example:</h4>
<pre>
Wait(SecondsToLoops(5.0));
</pre>
<p>Will wait for 5 seconds. However, see WaitSeconds below for an easier way.</p>

<hr />

<h3><a name="WaitSeconds">WaitSeconds</a></h3>
<pre>
// AGS 2.x and 3.x
WaitSeconds(float seconds);
</pre>
<p>Waits for a number of seconds, as opposed to AGS's Wait which uses loops.</p>
<h4>Example:</h4>
<pre>
WaitSeconds(5.0);
</pre>
<p>Will wait for 5 seconds.</p>

<hr />

<h3><a name="StopAllTweens">StopAllTweens</a></h3>
<pre>
// AGS 3.x
Character.StopAllTweens(optional TweenStopResult)
GUI.StopAllTweens(optional TweenStopResult)
Object.StopAllTweens(optional TweenStopResult)
Label.StopAllTweens(optional TweenStopResult)
Button.StopAllTweens(optional TweenStopResult)
TextBox.StopAllTweens(optional TweenStopResult)
ListBox.StopAllTweens(optional TweenStopResult)
Slider.StopAllTweens(optional TweenStopResult)
InvWindow.StopAllTweens(optional TweenStopResult)

// AGS 2.x
TweenStopAllForCharacter(Character* character, optional TweenStopResult)
TweenStopAllForGUI(GUI* gui, optional TweenStopResult)
TweenStopAllForObject(Object* object, optional TweenStopResult)
TweenStopAllForLabel(Label* label, optional TweenStopResult)
TweenStopAllForButton(Button* button, optional TweenStopResult)
TweenStopAllForTextBox(TextBox* textBox, optional TweenStopResult)
TweenStopAllForListBox(ListBox* listBox, optional TweenStopResult)
TweenStopAllForSlider(Slider* slider, optional TweenStopResult)
TweenStopAllForInvWindow(InvWindow* invWindow, optional TweenStopResult)
</pre>
<p>Stops all the Tweens currently playing on the a character, GUI, room object, etc.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
cEgo.StopAllTweens();
gIconbar.StopAllTweens();
oBluecup.StopAllTweens();

// AGS 2.x
TweenStopAllForCharacter(cEgo);
TweenStopAllForGUI(gIconbar);
TweenStopAllForObject(oBluecup);
</pre>
<p>Will stop all the tweens for cEgo, cIconbar, and oBluecup.</p>
<p><em>See Also</em>: <strong><a href="#TweenStopAll">TweenStopAll</a></strong></p>

<hr />

<h3><a name="TweenPosition">TweenPosition</a></h3>
<pre>
// AGS 3.x
Character.TweenPosition(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
GUI.TweenPosition(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
Object.TweenPosition(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
Label.TweenPosition(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
Button.TweenPosition(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
TextBox.TweenPosition(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
ListBox.TweenPosition(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
Slider.TweenPosition(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
InvWindow.TweenPosition(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)

// AGS 2.x
TweenCharacterPosition(Character* character, float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
TweenGUIPosition(GUI* gui, float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
TweenObjectPosition(Object* object, float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
TweenLabelPosition(Label* label, float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
TweenButtonPosition(Button* button, float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
TweenTextBoxPosition(TextBox* textBox, float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
TweenListBoxPosition(ListBox* listBox, float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
TweenSliderPosition(Slider* slider, float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
TweenInvWindowPosition(InvWindow* invWindow, float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle)
</pre>
<p>Tweens the position of a character, GUI, object, etc. from its current position to another. Note that by default, GUI tweens are non-blocking unlike the character and object tweens.</p>
<p>Returns the tween duration (in loops) if the TweenStyle is non-blocking (eNoBlockTween). For a repeat TweenStyle (eRepeatTween or eRepeatReverseTween) it returns the duration of one tween cycle. For blocking tweens, it returns a 1.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
cEgo.TweenPosition(2.5, 100, 100);

// AGS 2.x
TweenCharacterPosition(cEgo, 2.5, 100, 100);
</pre>
<p>Will tween the position of the character from its current position to x 100, y 100 in 2.5 seconds.</p>

<hr />

<h3><a name="TweenScaling">TweenScaling</a></h3>
<pre>
// AGS 3.x
Character.TweenScaling(float seconds, short toScale, optional TweenTiming, optional TweenStyle)

// AGS 2.x
TweenCharacterScaling(Character* character, float seconds, short toScale, optional TweenTiming, optional TweenStyle)
</pre>
<p>Tweens the scaling of a character.</p>
<p>Returns the tween duration (in loops) if the TweenStyle is non-blocking (eNoBlockTween). For a repeat TweenStyle (eRepeatTween or eRepeatReverseTween) it returns the duration of one tween cycle. For blocking tweens, it returns a 1.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
cEgo.TweenScaling(1.5, 200);

// AGS 2.x
TweenCharacterScaling(cEgo, 1.5, 200);
</pre>
<p>Will tween the scaling of Ego from its current scale to 200% in 1.5 seconds.</p>

<hr />

<h3><a name="TweenSize">TweenSize</a></h3>
<pre>
// AGS 3.x
GUI.TweenSize(float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
Label.TweenSize(float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
Button.TweenSize(float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
TextBox.TweenSize(float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
ListBox.TweenSize(float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
Slider.TweenSize(float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
InvWindow.TweenSize(float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)

// AGS 2.x
TweenGUISize(GUI* gui, float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
TweenLabelSize(Label* label, float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
TweenButtonSize(Button* button, float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
TweenTextBoxSize(TextBox* textBox, float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
TweenListBoxSize(ListBox* listBox, float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
TweenSliderSize(Slider* slider, float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
TweenInvWindowSize(InvWindow* invWindow, float seconds, short toWidth, short toHeight, optional TweenTiming, optional TweenStyle)
</pre>
<p>Tweens the size of a GUI, Label, Button etc.</p>
<p>Returns the tween duration (in loops) if the TweenStyle is non-blocking (eNoBlockTween). For a repeat TweenStyle (eRepeatTween or eRepeatReverseTween) it returns the duration of one tween cycle. For blocking tweens, it returns a 1.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
gStatusline.TweenSize(1.0, 50, 50);

// AGS 2.x
TweenGUISize(gStatusline, 1.0, 50, 50);
</pre>
<p>Will tween the size the statusline GUI from its current size to 50x50 pixels in 1 second.</p>

<hr />

<h3><a name="TweenStopAll">TweenStopAll</a></h3>
<pre>
// AGS 2.x and 3.x
TweenStopAll(optional TweenStopResult)
</pre>
<p>Stops every single tween currently playing.</p>
<h4>Example:</h4>
<pre>
TweenStopAll();
</pre>
<p>Will stop whatever tweens where currently playing, whether it was a GUI, character, or room object tween.</p>

<hr />

<h3><a name="TweenTransparency">TweenTransparency</a></h3>
<pre>
// AGS 3.x
Character.TweenTransparency(float seconds, short toTransparency, optional TweenTiming, optional TweenStyle)
GUI.TweenTransparency(float seconds, short toTransparency, optional TweenTiming, optional TweenStyle)
Object.TweenTransparency(float seconds, short toTransparency, optional TweenTiming, optional TweenStyle)

// AGS 2.x
TweenCharacterTransparency(Character* character, float seconds, short toTransparency, optional TweenTiming, optional TweenStyle)
TweenGUITransparency(GUI* gui, float seconds, short toTransparency, optional TweenTiming, optional TweenStyle)
TweenObjectTransparency(Object* object, float seconds, short toTransparency, optional TweenTiming, optional TweenStyle)
</pre>
<p>Tweens the transparency of a character, GUI, or object from its current transparecy to another. Note that by default, GUI tweens are non-blocking unlike the character and object tweens.</p>
<p>Returns the tween duration (in loops) if the TweenStyle is non-blocking (eNoBlockTween). For a repeat TweenStyle (eRepeatTween or eRepeatReverseTween) it returns the duration of one tween cycle. For blocking tweens, it returns a 1.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
oBluecup.TweenTransparency(3.0, 100);

// AGS 2.x
TweenObjectTransparency(oBluecup, 3.0, 100);
</pre>
<p>Will tween the transparency of the room object Bluecup to from its current value to 100% (thus fading it out).</p>

<hr />

<h3><a name="TweenViewportX">TweenViewportX</a></h3>
<pre>
// AGS 2.x and 3.x
TweenViewportX(float seconds, short toX, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the location of the viewport on the x axis from its current location to another.</p>
<h4>Example:</h4>
<pre>
TweenViewportX(3.0, 100);
</pre>
<p>Will tween the location of the viewport on the x axis from its current location to 100.</p>

<hr />

<h3><a name="TweenViewportY">TweenViewportY</a></h3>
<pre>
// AGS 2.x and 3.x
TweenViewportY(float seconds, short toY, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the location of the viewport on the y axis from its current location to another.</p>
<h4>Example:</h4>
<pre>
TweenViewportY(3.0, 100);
</pre>
<p>Will tween the location of the viewport on the y axis from its current location to 100.</p>

<hr />

<h3><a name="TweenViewportXY">TweenViewportXY</a></h3>
<pre>
// AGS 2.x and 3.x
TweenViewportX(float seconds, short toX, short toY, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the location of the viewport on the x axis and on the y axis from its current location to another.</p>
<h4>Example:</h4>
<pre>
TweenViewportX(3.0, 100, 20);
</pre>
<p>Will tween the location of the viewport on the x axis from its current location to 100, and on the y axis from the current locatio to 20.</p>

<hr />

<h3><a name="TweenGamma">TweenGamma</a></h3>
<pre>
// AGS 2.x and 3.x
TweenGamma(float seconds, short toGamma, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the screen gamma level from its current value to another. Note that System.SupportGammaControl must return true in order for this method to have any effect. Range: 0 (black) - 200 (bright)</p>
<h4>Example:</h4>
<pre>
if (System.SupportsGammaControl) {
  TweenGamma(3.0, 150);
}
</pre>
<p>Will tween the screen gamma from its current value to 150 (which is 50% brighter than default).</p>

<hr />

<h3><a name="TweenShakeScreen">TweenShakeScreen</a></h3>
<pre>
// AGS 2.x and 3.x
TweenShakeScreen(float seconds, short fromDelay, short toDelay, short fromAmount,  short toAmount, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the shake screen amount and delay from one value to another. Range: Delay: from -2 to ... Amount: from 1 to 30.</p>
<h4>Example:</h4>
<pre>
TweenShakeScreen(3.0, 2, 2, 1, 15);
</pre>
<p>Will tween the shake screen amount from 1 to 15 with a constant delay of 2.</p>

<hr />

<h3><a name="TweenMusicMasterVolume">TweenMusicMasterVolume</a></h3>
<pre>
// AGS 2.x and 3.x
TweenMusicMasterVolume(float seconds, short fromVolume, short toVolume, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the master music volume from one value to another. Range: 1 - 100.</p>
<h4>Example:</h4>
<pre>
TweenMusicMasterVolume(3.0, 100, 50);
</pre>
<p>Will tween the music volume from 100 to 50.</p>

<hr />

<h3><a name="TweenAreaScaling">TweenAreaScaling</a></h3>
<pre>
// AGS 2.x and 3.x
TweenAreaScaling(float seconds, short area, short fromMin, short toMin, short fromMax, short toMax, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the area scaling for a specific area from one min and max value to another. Range for min and max: 5 - 200.</p>
<h4>Example:</h4>
<pre>
TweenAreaScaling(3.0, 1, 50, 100, 100, 200);
</pre>
<p>Will tween the scaling for area 1 from 50-100 to 100-200.</p>

<hr />

<h3><a name="TweenImage">TweenImage</a></h3>
<pre>
// AGS 3.x
Object.TweenImage(Object* tmpObjectRef, float seconds,  short toSprite,  optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenObjectImage(Object* object, Object* tmpObjectRef,  float seconds,  short toSprite,  optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the image of the object.</p>
<p>Note that this function currently requires the use of a second object for the transformation to take effect.
Just create an invisible object in the room and pass it to the function (when AGS will support creating objects from code this won't be necessary).</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
oBlueCup.TweenImage(oTmpObject, 1.5, 167);

// AGS 2.x
TweenObjectImage(oBlueCup, oTmpObject, 1.5, 167);
</pre>
<p>Will tween the image of the BlueCup object from its current sprite to sprite 167.</p>

<hr />

<h3><a name="TweenAnimationSpeed">TweenAnimationSpeed</a></h3>
<pre>
// AGS 3.x
Character.TweenAnimationSpeed(float seconds, short toAnimationSpeed, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenCharacterAnimationSpeed(Character* characterRef, float seconds, short toAnimationSpeed, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the animation speed of the character.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
cEgo.TweenAnimationSpeed(1.5, -100); 

// AGS 2.x
TweenCharacterAnimationSpeed(cEgo, 1.5, -100);
</pre>
<p>Will tween the animation speed of the character from its current animation speed to -100 (which is really fast).</p>

<hr />

<h3><a name="TweenZOrder">TweenZOrder</a></h3>
<pre>
// AGS 3.x
GUI.TweenZOrder(GUI* guiRef, float seconds, short toZOrder, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenGUIZOrder(GUI* guiRef, float seconds, short toZOrder, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the Z Order of the gui.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
gStatusLine.TweenZOrder(1.5, 100); 

// AGS 2.x
TweenGUIZOrder(gStatusLine, 1.5, 100);
</pre>
<p>Will tween the Z order of the statusLine Gui from its current Z order to 100 (which is in the behind 100 other guis).</p>

<hr />

<h3><a name="TweenLightLevel">TweenLightLevel</a></h3>
<pre>
// AGS 3.x
Region.TweenLightLevel(float seconds, short toLightLevel, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenRegionLightLevel(Region* regionRef, float seconds, short toLightLevel, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the light level for the region. Range: -100 (very dark) to 100 (very bright)</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
rGarden.TweenLightLevel(1.5, 0); 

// AGS 2.x
TweenRegionLightLevel(rGarden, 1.5, 0);
</pre>
<p>Will tween the light level of the garden region from its current light level to 0 (which is very dark).</p>

<hr />

<h3><a name="TweenTintR">TweenTintR</a></h3>
<pre>
// AGS 3.x
Region.TweenTintR(float seconds, short toR, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenRegionTintR(Region* regionRef, float seconds, short toR, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the Red portion for the region. Range: 0 to 255.</p>
<p>Note that to diminish the effect of the tint you need to set the LightLevel property for the region.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
rGarden.TweenTintR(1.5, 200); 

// AGS 2.x
TweenRegionTintR(rGarden, 1.5, 200);
</pre>
<p>Will tween the Red portion of the garden region from its current portion to 200 (which is pretty red).</p>

<hr />

<h3><a name="TweenTintG">TweenTintG</a></h3>
<pre>
// AGS 3.x
Region.TweenTintG(float seconds, short toG, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenRegionTintG(Region* regionRef, float seconds, short toG, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the Green portion for the region. Range: 0 to 255.</p>
<p>Note that to diminish the effect of the tint you need to set the LightLevel property for the region.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
rGarden.TweenTintG(1.5, 200); 

// AGS 2.x
TweenRegionTintG(rGarden, 1.5, 200);
</pre>
<p>Will tween the Green portion of the garden region from its current portion to 200 (which is pretty green).</p>

<hr />

<h3><a name="TweenTintB">TweenTintB</a></h3>
<pre>
// AGS 3.x
Region.TweenTintB(float seconds, short toB, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenRegionTintB(Region* regionRef, float seconds, short toB, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the Blue portion for the region. Range: 0 to 255.</p>
<p>Note that to diminish the effect of the tint you need to set the LightLevel property for the region.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
rGarden.TweenTintB(1.5, 200); 

// AGS 2.x
TweenRegionTintB(rGarden, 1.5, 200);
</pre>
<p>Will tween the Blue portion of the garden region from its current portion to 200 (which is pretty blue).</p>

<hr />

<h3><a name="TweenTintAmount">TweenTintAmount</a></h3>
<pre>
// AGS 3.x
Region.TweenTintAmount(float seconds, short toAmount, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenRegionTintAmount(Region* regionRef, float seconds, short toAmount, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the amount of tint for the region. Range: 0 to 100.</p>
<p>Note that to diminish the effect of the tint you need to set the LightLevel property for the region.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
rGarden.TweenTintAmount(1.5, 100); 

// AGS 2.x
TweenRegionTintAmount(rGarden, 1.5, 100);
</pre>
<p>Will tween the amount of tint of the garden region from its current amount to 100%.</p>

<hr />

<h3><a name="TweenTintBlackAndWhite">TweenTintBlackAndWhite</a></h3>
<pre>
// AGS 3.x
Region.TweenTintBlackAndWhite(float seconds, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenRegionTintBlackAndWhite(Region* regionRef, float seconds, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the region to appear black and white.</p>
<p>Note that to diminish the effect of the tint you need to set the LightLevel property for the region.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
rGarden.TweenTintBlackAndWhite(1.5); 

// AGS 2.x
TweenRegionTintBlackAndWhite(rGarden, 1.5);
</pre>
<p>Will tween the garden region look from its current look to black and white.</p>

<hr />

<h3><a name="TweenColorR">TweenColorR</a></h3>
<pre>
// AGS 3.x
Label.TweenColorR(float seconds, short toR, optional TweenTiming, optional TweenStyle);
TextBox.TweenColorR(float seconds, short toR, optional TweenTiming, optional TweenStyle);
Button.TweenColorR(float seconds, short toR, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenLabelColorR(Label* label, float seconds, short toR, optional TweenTiming, optional TweenStyle);
TweenTextBoxColorR(TextBox* textBox, float seconds, short toR, optional TweenTiming, optional TweenStyle);
TweenButtonColorR(Button* button, float seconds, short toR, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the red portion for the label, textbox or button. Range: 0 - 255</p>
<p>Note that to get a better result start with a color that is bigger than 30 (since 0 - 30 are reserved colors).</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
myLabel.TweenColorR(1.5, 200); 
myTextBox.TweenColorR(1.5, 200); 
myButton.TweenColorR(1.5, 200); 

// AGS 2.x
TweenLabelColorR(myLabel, 1.5, 200);
TweenTextBoxColorR(myTextBox, 1.5, 200);
TweenButtonColorR(myButton, 1.5, 200);
</pre>
<p>Will tween the red portion of the color of the label, textbox and button from the current portion to 200 (which is pretty red).</p>

<hr />

<h3><a name="TweenColorG">TweenColorG</a></h3>
<pre>
// AGS 3.x
Label.TweenColorG(float seconds, short toG, optional TweenTiming, optional TweenStyle);
TextBox.TweenColorG(float seconds, short toG, optional TweenTiming, optional TweenStyle);
Button.TweenColorG(float seconds, short toG, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenLabelColorG(Label* label, float seconds, short toG, optional TweenTiming, optional TweenStyle);
TweenTextBoxColorG(TextBox* textBox, float seconds, short toG, optional TweenTiming, optional TweenStyle);
TweenButtonColorG(Button* button, float seconds, short toG, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the green portion for the label, textbox or button. Range: 0 - 255</p>
<p>Note that to get a better result start with a color that is bigger than 30 (since 0 - 30 are reserved colors).</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
myLabel.TweenColorG(1.5, 200); 
myTextBox.TweenColorG(1.5, 200); 
myButton.TweenColorG(1.5, 200); 

// AGS 2.x
TweenLabelColorG(myLabel, 1.5, 200);
TweenTextBoxColorG(myTextBox, 1.5, 200);
TweenButtonColorG(myButton, 1.5, 200);
</pre>
<p>Will tween the green portion of the color of the label, textbox and button from the current portion to 200 (which is pretty green).</p>

<hr />

<h3><a name="TweenColorB">TweenColorB</a></h3>
<pre>
// AGS 3.x
Label.TweenColorB(float seconds, short toB, optional TweenTiming, optional TweenStyle);
TextBox.TweenColorB(float seconds, short toB, optional TweenTiming, optional TweenStyle);
Button.TweenColorB(float seconds, short toB, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenLabelColorB(Label* label, float seconds, short toB, optional TweenTiming, optional TweenStyle);
TweenTextBoxColorB(TextBox* textBox, float seconds, short toB, optional TweenTiming, optional TweenStyle);
TweenButtonColorB(Button* button, float seconds, short toB, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the blue portion for the label, textbox or button. Range: 0 - 255</p>
<p>Note that to get a better result start with a color that is bigger than 30 (since 0 - 30 are reserved colors).</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
myLabel.TweenColorB(1.5, 200); 
myTextBox.TweenColorB(1.5, 200); 
myButton.TweenColorB(1.5, 200); 

// AGS 2.x
TweenLabelColorB(myLabel, 1.5, 200);
TweenTextBoxColorB(myTextBox, 1.5, 200);
TweenButtonColorB(myButton, 1.5, 200);
</pre>
<p>Will tween the blue portion of the color of the label, textbox and button from the current portion to 200 (which is pretty blue).</p>

<hr />

<h3><a name="TweenValue">TweenValue</a></h3>
<pre>
// AGS 3.x
Slider.TweenValue(float seconds, short toValue, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenSliderValue(float seconds, short toValue, optional TweenTiming, optional TweenStyle);
</pre>

<p>Tweens the value of the slider.</p>
<p>Note that the value should be between the min and max values for the slider.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
mySlider.TweenValue(1.5, 200); 

// AGS 2.x
TweenSliderValue(mySlider, 1.5, 200);
</pre>

<p>Will tween the value of the slider from the current value to 200.</p>

<hr />

<h3><a name="TweenHandleOffset">TweenHandleOffset</a></h3>
<pre>
// AGS 3.x
Slider.TweenHandleOffset(float seconds, short toOffset, optional TweenTiming, optional TweenStyle);

// AGS 2.x NOT SUPPORTED
</pre>

<p>Tweens the offset of the slider handle.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
mySlider.TweenHandleOffset(1.5, 20); 
</pre>

<p>Will tween the handle offset of the slider from the current value to 20.</p>

<hr />

<h3><a name="TweenSelectedItem">TweenSelectedItem</a></h3>

<pre>
// AGS 3.x
ListBox.TweenSelectedItem(float seconds, short toSelectedItem, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenListBoxSelectedItem(ListBox* listBox, float seconds, short toSelectedItem, optional TweenTiming, optional TweenStyle);
</pre>

<p>Tweens the selected item for the list box.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
myListBox.TweenSelectedItem(1.5, 20); 

// AGS 2.x
TweenListBoxSelectedItem(myListBox, 1.5, 20);
</pre>

<p>Will tween the selected item of the listbox from the current value to 20.</p>

<hr />

<h3><a name="TweenTopItem">TweenTopItem</a></h3>
<pre>
// AGS 3.x
ListBox.TweenTopItem(float seconds, short toTopItem, optional TweenTiming, optional TweenStyle);
InvWindow.TweenTopItem(float seconds, short toTopItem, optional TweenTiming, optional TweenStyle);

// AGS 2.x
TweenListBoxTopItem(ListBox* listBox, float seconds, short toTopItem, optional TweenTiming, optional TweenStyle);
TweenInvWindowTopItem(ListBox* listBox, float seconds, short toTopItem, optional TweenTiming, optional TweenStyle);
</pre>

<p>Tweens the top item for the list box or inventory window.</p>
<h4>Example:</h4>
<pre>
// AGS 3.x
myListBox.TweenTopItem(1.5, 20); 
myInventory.TweenTopItem(1.5, 20); 

// AGS 2.x
TweenListBoxTopItem(myListBox, 1.5, 20);
TweenInvWindowTopItem(myInventory, 1.5, 20);
</pre>

<p>Will tween the top item of the listbox and inventory window from the current value to 20.</p>

<hr />

<h3><a name="TweenSoundVolume">TweenSoundVolume</a></h3>
<pre>
// AGS 2.x and 3.x
TweenSoundVolume(float seconds, short fromVolume, short toVolume, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the sound effect volume from one value to another. Range: 0 - 255.</p>
<h4>Example:</h4>
<pre>
TweenSoundVolume(3.0, 100, 50);
</pre>

<p>Will tween the sound effect volume from 100 to 50.</p>

<hr />

<h3><a name="TweenDigitalMasterVolume">TweenDigitalMasterVolume</a></h3>
<pre>
// AGS 2.x and 3.x (without new-style audio scripting enforced)
TweenDigitalMasterVolume(float seconds, short fromVolume, short toVolume, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the master digital volume from one value to another. Range: 1 - 100.</p>
<h4>Example:</h4>
<pre>
TweenDigitalMasterVolume(3.0, 100, 50);
</pre>

<p>Will tween the digital volume from 100 to 50.</p>
<hr />

<h3><a name="TweenChannelVolume">TweenChannelVolume</a></h3>
<pre>
// AGS 2.x and 3.x (without new-style audio scripting enforced)
TweenChannelVolume(float seconds, short channel, short fromVolume, short toVolume, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the volume for a given channel from one value to another. Range: 0 - 255.</p>
<h4>Example:</h4>
<pre>
TweenChannelVolume(3.0, 1, 100, 50);
</pre>

<p>Will tween the volume for channel 1 from 100 to 50.</p>

<hr />

<h3><a name="TweenSpeechVolume">TweenSpeechVolume</a></h3>
<pre>
// AGS 2.x and 3.x (without new-style audio scripting enforced)
TweenSpeechVolume(float seconds, short fromVolume, short toVolume, optional TweenTiming, optional TweenStyle);
</pre>
<p>Tweens the volume for speech from one value to another. Range: 0 - 255.</p>
<h4>Example:</h4>
<pre>
TweenSpeechVolume(3.0, 100, 50);
</pre>

<p>Will tween the volume for speech from 100 to 50.</p>

<hr />

</div>

</div>
</body>

</html>